﻿@using System.Data
@using ZoomLa.Model
@using ZoomLa.BLL
@using ZoomLa.BLL.Helper
@using ZoomLa.Common
@model ZoomLa.SQLDAL.SQL.PageSetting
@functions{
    B_IServer isBll = new B_IServer();
}
@{ 
    M_UserInfo mu = new B_User().GetLogin();
    DataTable typeDT = isBll.GetSeachUserIdType(mu.UserID);
    int tab = DataConverter.CLng(Request["num"],-100);
}
@section head{<title>有问必答</title>}
@section content{
    <div id="pageflag" data-nav="index" data-ban="cnt"></div>
    <div class="container margin_t5">
        <ol class="breadcrumb">
            <li><a title="会员中心" href="/User/Default">会员中心</a></li>
            <li class="active"><a href="FIServer">有问必答</a></li>
            <div class="input-group text_300" style="margin:5px 10px;display: inline-flex;">
                <input type="text" id="skey_t" class="form-control text_300 mvcparam" placeholder="请输入标题" />
                <span class="input-group-btn">
                    <button class="btn btn-info" type="button" title="搜索" onclick="mvcpage.load();">搜索</button>
                </span>
            </div>
        </ol>
    </div>
    <div class="container btn_green">
        <table class="table table-striped table-bordered table-hover">
            <tr><td colspan="2" class="title" style="text-align: center">工单列表</td></tr>
            <tr align="left" class="tdbg">
                <td width="100"><a href="SelectiServer"><b>全部:</b></a></td>
                <td>
                    <a class="btn btn-default" title="浏览">@ViewBag.allnum</a>
                </td>
            </tr>
            <tr align="left" >
                <td>
                    <a><font color="red">未解决:</font></a>
                </td>
                <td>
                    <a class="btn btn-default" title="浏览">@ViewBag.nrslvnum</a>
                </td>
            </tr>
            <tr >
                <td>
                    <a><font color="brown">处理中:</font></a>
                </td>
                <td>
                     <a class="btn btn-default" title="浏览">@ViewBag.treatnum</a>
                </td>
            </tr>
            <tr >
                <td>
                    <a><font color="green">已解决:</font></a>
                </td>
                <td>
                    <a class="btn btn-default" title="浏览">@ViewBag.rslvnum</a>
                </td>
            </tr>
            <tr >
                <td>
                    <a><font color="gray">已锁定:</font></a>
                </td>
                <td>
                     <a class="btn btn-default" title="浏览">@ViewBag.socknum</a>
                </td>
            </tr>
        </table>
        <div class="alert alert-info">
            <a href="FIserver?num=@tab" class="btn btn-default">全部</a>
            @foreach (DataRow dr in typeDT.Rows)
            {
                <a class="btn btn-default" href="FIServer?num=@(tab)&type=@isBll.GetTypeIndex(DataConverter.CStr(dr["type"]))">@dr["type"]</a>
            }
        </div>
        <ul class="nav nav-tabs" style="height:42px;">
            <li data-tab="-100"><a href="FiServer" role="tab">所有问题</a></li>
            <li data-tab="1"><a href="FiServer?num=1">待解决</a></li>
            <li data-tab="2"><a href="FiServer?num=2">处理中</a></li>
            <li data-tab="3"><a href="FiServer?num=3" role="tab">已解决</a></li>
            <li data-tab="-1"><a href="FiServer?num=-1" role="tab">已关闭</a></li>
            <a href="AddQuestion" class="btn btn-info" style="margin-left:10px;"><i class="fa fa-plus"></i> 提交新问题</a>
        </ul>
        @Html.Partial("FiServer_List",Model)
    </div>
}
@section script{
    <script type="text/javascript">
        $(function () {
            var num = $("#typeList").find("a[name='type']").length;
            if (parseInt(num) == 0) { $("#typeList").hide(); }
            $(".nav li[data-tab=@tab]").addClass("active");
               
        });
        function seach() {
            location.href = 'SelectiServer?num=-1&menu=@Request.QueryString["menu"]&strTitle=' + $("#skey_t").val();
        }
        //function postAPI(action, id) {
        //    if(!confirm("确定要执行该操作吗")){return false;}
        //    $.post("IServer_API?action=" + action + "&id=" + id, {}, function () {
        //        location = location;
        //    })
        //}
    </script>
}
